<template>
    <div>
        <h1>哈哈</h1>
        <table>
            <tr v-for="i in namelist">
                <td>{{i.name}}</td>
            </tr>
        </table>
    </div>
</template>

<script>
export default {
    data:function(){
        return{
            namelist:[]
        }
    },
    methods:{
        init:function(){
            this.axios({
                url: "http://127.0.0.1:8000/new/",
                method: "get"
            }).then((res)=>{
                if (res.data.code==200)
                {
                    namelist = res.data.message;
                }
            })
        }
    },
    mounted(){
        this.init()
    }
}
</script>
